<!--_meta 作为公共模版分离出去-->
{include file="public/meta" /}
<!--/meta 作为公共模版分离出去-->
<title>香烟列表</title>
<link rel="stylesheet" href="lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="wap-container">
    <nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">
        首页
        <span class="c-gray en">/</span>
        香烟管理
        <span class="c-gray en">/</span>
        香烟列表
        <a class="btn btn-success radius f-r" style="line-height:1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
    <article class="Hui-admin-content clearfix">
        <div class="panel">
            <form class="layui-form layui-form-pane" action="{:url('chongfu_delete')}" method="get">
            <div class="panel-body">
                <div class="text-c"> 日期范围：
                    <input type="text" name="name" value="{$name}" placeholder="名称" style="width:250px" class="input-text">
                    <button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索
                    </button>
                </div>
            </div>
            </form>
        </div>

        <div class="panel mt-20">
            <div class="panel-body">
                <div class="clearfix">
                    <a class="btn btn-primary radius" href="javascript:;"
                       onclick="admin_add('添加品牌','/admin/smoke/edit')"><i class="Hui-iconfont">&#xe600;</i> 添加香烟</a>
                    <span class="f-r">共有数据：<strong>{$count}</strong> 条</span>
                </div>
                <div class="mt-20 clearfix">
                    <table class="table table-border table-bordered table-bg table-hover table-sort">
                        <thead>
                        <tr class="text-c">
                            <th width="40">ID</th>
                            <th width="40">名称</th>
                            <th width="50">封面</th>
                            <th width="50">品牌</th>
                            <th width="60">条形码</th>
                            <th width="60">价格</th>
                            <th width="30">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="model" id="vo"}
                        <tr class="text-c va-m">
                            <td>{$vo.id}</td>
                            <td><img width="60" height="100" class="product-thumb" src="{$vo.img}"></td>
                            <td>{$vo.name}</td>
                            <td>{$vo.brand_name}</td>
                            <td>{$vo.carton_code}</td>
                            <td>{$vo.price}</td>
                            <td class="td-manage">
                                <a style="text-decoration:none" class="ml-5" onclick="admin_add('香烟编辑','{:url(\'smoke/edit\',[\'id\'=>$vo.id])}')" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </article>
</div>
<!--_footer 作为公共模版分离出去-->
{include file="public/footer" /}
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/ueditor/1.4.3/ueditor.all.min.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/webuploader/0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/static/business/js/main.js"></script>
<!--/请在上方写此页面业务相关的脚本-->
<script type="text/javascript">
    function product_img(obj,name){
        alert(123);
        return ;
        // window.open('_blank').location="https://www.baidu.com/s?ie=utf8&oe=utf8&wd="+name+"&tn=98010089_dg";
        window.open('_blank').location="https://search.douban.com/book/subject_search?search_text="+name+"&cat=1001";
    }
    function upimg(obj,id) {
        if (obj.value == "") {
            return;
        }
        var formdata = new FormData();
        //<input type="file" name="img" value="" />
        formdata.append("img", $(obj)[0].files[0]);//获取文件法二
        formdata.append("id", id);//获取文件法二
        $.ajax({
            type: 'post',
            url: "image_book", //接口
            data: formdata,
            cache: false,
            processData: false, // 不处理发送的数据，因为data值是Formdata对象，不需要对数据做处理
            contentType: false, // 不设置Content-type请求头
            success: function (response) {
                if (response.code == 1) {
                    layer.msg(response.msg, {
                        icon: 6,
                        time: 1000 //2秒关闭（如果不配置，默认是3秒）
                    });
                } else {
                    layer.msg('完成失败', {icon: 2, time: 1000});
                }
            },
            error: function () {
            }
        });
    }
    $(function () {
        runDatetimePicker();
        $('.table-sort').dataTable({})
        // 全选 页面调用
        $(".table").HuicheckAll(
            {
                checkboxAll: 'thead input[type="checkbox"]',
                checkbox: 'tbody input[type="checkbox"]'
            },
            function (checkedInfo) {
                console.log(checkedInfo);
            }
        )
    });
</script>
</body>
</html>
